<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fm" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>商品</title>
    <link href="../css/table.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
    <script type="text/javascript" src="../js/table.js"></script>
</head>

<style type="text/css">
    #header, #content {
        width: 99%;
    }
    .anniu {
        margin-left: 500px;
    }
</style>

<script type="text/javascript">
    function productListEditSubmit() {
        document.operationForm.action="${pageContext.request.contextPath}/product/productMapEditSubmit.action";
        document.operationForm.submit();
    }
</script>

<body>
<h2>修改所有商品列表</h2>

    <form name="operationForm" action="" method="post" class="anniu">
        <input type="button" onclick="javascript:productListEditSubmit()" value="修改所有商品提交">

        <table >
            <tr>
                <th>商品编号</th>
                <th>商品名</th>
                <th>价格</th>
                <th>详情</th>
                <th>创建日期</th>
            </tr>
            <c:forEach var="list" items="${lists}">
                <tr>
                    <td><input type="text" name="productAndUserMap['id']" value="${list.id}"></td>
                    <td><input type="text" name="productAndUserMap['name']" value="${list.name}"></td>
                    <td><input type="text" name="productAndUserMap['price']" value="${list.price}"></td>
                    <td><input type="text" name="productAndUserMap['detail']" value="${list.detail}"></td>
                    <td><input type="text" name="productAndUserMap['createtime']" value="<fm:formatDate value="${list.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/>"></td>
                </tr>
            </c:forEach>
        </table>

    </form>
</body>
</html>

